import java.util.Scanner;

public class Work {
    //求出1~100之间的素数
    public static void main1(String[] args) {
        //外层生成被除数
        for (int i = 2; i < 100; i++) {
            boolean flg = false;
            //内层生成除数
            for (int j = 2; j < i; j++) {//j不能等于1，等于1的话，每进来一个数i%1 都等于0
                if(i%j == 0){
                    flg = true;
                    break;//跳出内层循环
                }
            }
            if(flg == false){
                System.out.print(i+" ");
            }
        }
    }

    public static void main2(String[] args) {
        for (int i = 0; i < 100; i++) {
            if( i%10 == 9 || i/10 == 9){
                System.out.print(i+" ");
            }
        }
    }

    public static void main3(String[] args) {
        for (int i = 1000; i <= 2000; i++) {
            if( (i%4 == 0) && ((i%100 != 0) || (i%400 == 0))){
                System.out.print(i+" ");
            }
        }
    }

    public static void main4(String[] args) {
        Scanner scan = new Scanner(System.in);
        int b = scan.nextInt();
        for (int i = 2; i < b; i++) {
            if(b/i != 0){
                break;
            }
        }
        System.out.println(b+"是素数");
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int count = 0;
        while(num!=0){
            if((num&1) == 1){
                count++;
            }
            num = num>>1;//表示向右移动一位，右边补0
        }
        System.out.println(count);
    }
}
